{% extends "layout/site.html" %}
{% block title %}修改密码{% endblock %}
{% block content %}
    {%set messages=handler.get_flashed_messages() %}
    {%-if messages-%}
        <div>
            {% for type, msg in messages%}
                {{msg}}
            {% endfor %}
        </div>
    {%-endif-%}
    <form action="" method="post">
        {{xsrf()}}
        手机号码：<input type="text" name="mobile" id="mobile" maxlength=11 size="15"><br>
        密码：<input type="password" name="password" size="15"><br>
        确认密码：<input type="password" name="apassword" size="15"><br>
        验证码：<input type="text" name="vcode" maxlength=4 size="4"> <a href="" id="getvcode">获取验证码</a><br>
        <input type="submit" name="sub" value="注册">
    </form>
{% endblock %}

{% block foot %}
<script>
    $('#getvcode').click(function(event) {
        $.ajax({
            'url' : '/ajax/vcode?mobile=' + $('#mobile').val() + '&rt='+ Math.floor((Math.random()*100)+1),
            'type' : 'GET',
            'cache' : false,
            'dataType' : 'json',
            'success' : function(result) {
                if(result.status)
                {
                    alert('发送成功');
                } else {
                    alert('发送失败');
                }
            }
        });
        return false;
    });
</script>
{% endblock %}